function change() {
    var $body = $('body');
    var $footer = $('.footer');

    var bodyHeight = $body.height();  //网页可见元素的高度

    var allHeight = bodyHeight;

    var isAbsExist = false;

    if ($footer.hasClass('abs-bottom')) {  //如果尾部存在绝对定位,网页总高度要加上尾部的高度
        isAbsExist = true;
        allHeight += $footer.height();
    }

    if (getWinHeight() < allHeight) {  //窗口高度小于网页总高度时
        if (isAbsExist) {
            $('.footer').removeClass("abs-bottom");
        }
    } else {  //当窗口高度大于网页总高度时
        if (!isAbsExist) {
            $('.footer').addClass("abs-bottom");
        }
    }
}

change();

$(window).resize(function () {  //窗口大小改变时进行改变
    change();
})

function getWinHeight() { //获取窗口高度的函数。
    var e = window,
        a = 'inner';
    if (!('innerWidth' in window)) {
        a = 'client';
        e = document.documentElement || document.body;
    }
    return e[a + 'Height'];
}

function NewDate(str) {
    str = str.split('-');
    var date = new Date();
    date.setUTCFullYear(str[0], str[1] - 1, str[2]);
    date.setUTCHours(0, 0, 0, 0);
    return date;
}

function momxc() {
    var birthDay = NewDate("2022-09-06");
    var today = new Date();
    var timeold = today.getTime() - birthDay.getTime();
    var sectimeold = timeold / 1000
    var secondsold = Math.floor(sectimeold);
    var msPerDay = 24 * 60 * 60 * 1000;
    var e_daysold = timeold / msPerDay;
    var daysold = Math.floor(e_daysold);
    var e_hrsold = (daysold - e_daysold) * -24;
    var hrsold = Math.floor(e_hrsold);
    var e_minsold = (hrsold - e_hrsold) * -60;
    var minsold = Math.floor((hrsold - e_hrsold) * -60);
    var seconds = Math.floor((minsold - e_minsold) * -60).toString();
    document.getElementById("momk").innerHTML =
        "靠谱锅的小站已正常运行：" + "❤️" + daysold + "天" + hrsold + "小时" +
        minsold + "分" + seconds + "秒" + "❤️"
    setTimeout(momxc, 1000);
}

momxc();
